Fix use of uninitialized memory in ostree_builtin_checksum()
authorStef Walter <stefw@redhat.com>
Wed, 14 Aug 2013 08:20:41 +0000 (10:20 +0200)
committerStef Walter <stefw@gnome.org>
Sat, 17 Aug 2013 05:07:54 +0000 (07:07 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=705968

src/ostree/ot-builtin-checksum.c

index aa82a9773fa16b05d67210f32bd1b653b3902078..999bdd2556321930ec5f2c30e13e4f690ca09382 100644 (file)
@@ -26,6 +26,8 @@
 #include "ostree.h"
 #include "libgsystem.h"
 
+#include <string.h>
+
 static GOptionEntry options[] = {
   { NULL }
 };
@@ -61,6 +63,8 @@ ostree_builtin_checksum (int argc, char **argv, GFile *repo_path_path, GCancella
   gs_unref_object GFile *f = NULL;
   AsyncChecksumData data;
 
+  memset (&data, 0, sizeof (data));
+
   context = g_option_context_new ("FILENAME - Checksum a file or directory");
   g_option_context_add_main_entries (context, options, NULL);